//
//  SecondCell.m
//  MyTest
//
//  Created by zhiyou on 16-4-14.
//  Copyright (c) 2016年 wangyang. All rights reserved.
//

#import "SecondCell.h"

@implementation SecondCell

- (void)awakeFromNib {
    // Initialization code
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        self.backgroundColor = [UIColor lightGrayColor];
        _view1 = [[UIView alloc] init];
        _view1.tag = 200;
        _view1.backgroundColor = [UIColor whiteColor];
        [self addSubview:_view1];
        
        _view2 = [[UIView alloc] init];
        _view2.tag = 201;
        _view2.backgroundColor = [UIColor whiteColor];
        [self addSubview:_view2];
        
        _view3 = [[UIView alloc] init];
        _view3.tag = 202;
        _view3.backgroundColor = [UIColor whiteColor];
        [self addSubview:_view3];
        
        
        [_view1 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.left.bottom.offset(0);
            make.width.equalTo(self.mas_width).multipliedBy(.33);
            make.height.equalTo(self.mas_height);
        }];
        [_view2 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.bottom.offset(0);
            make.width.equalTo(self.mas_width).multipliedBy(.33);
            make.height.equalTo(self.mas_height);
            make.left.equalTo(_view1.mas_right).offset(2);
        }];
        [_view3 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.top.right.offset(0);
            make.width.equalTo(self.mas_width).multipliedBy(.33);
        }];
        
        _titleLabel1 = [[UILabel alloc] init];
        _titleLabel1.font = [UIFont systemFontOfSize:14];
        [_view1 addSubview:_titleLabel1];
        _subTitleLable1 = [[UILabel alloc] init];
        _subTitleLable1.font = [UIFont systemFontOfSize:11];
        [_view1 addSubview:_subTitleLable1];
        _imgView1 = [[UIImageView alloc] init];
        [_view1 addSubview:_imgView1];
        
        _titleLabel2 = [[UILabel alloc] init];
        _titleLabel2.font = [UIFont systemFontOfSize:14];
        [_view2 addSubview:_titleLabel2];
        _subTitleLable2 = [[UILabel alloc] init];
        _subTitleLable2.font = [UIFont systemFontOfSize:11];
        [_view2 addSubview:_subTitleLable2];
        _imgView2 = [[UIImageView alloc] init];
        [_view2 addSubview:_imgView2];
        
        _titleLabel3 = [[UILabel alloc] init];
        _titleLabel3.font = [UIFont systemFontOfSize:14];
        [_view3 addSubview:_titleLabel3];
        _subTitleLable3 = [[UILabel alloc] init];
        _subTitleLable3.font = [UIFont systemFontOfSize:11];
        [_view3 addSubview:_subTitleLable3];
        _imgView3 = [[UIImageView alloc] init];
        [_view3 addSubview:_imgView3];
        
        [_titleLabel1 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.offset(10);
            make.centerX.equalTo(_view1.mas_centerX);
            make.width.equalTo(_view1.mas_width).multipliedBy(.6);
            make.height.equalTo(_view1.mas_height).multipliedBy(.15);
        }];
        [_subTitleLable1 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(_titleLabel1.mas_bottom).offset(2);
            make.centerX.equalTo(_view1.mas_centerX);
            make.width.equalTo(_view1.mas_width).multipliedBy(.6);
            make.height.equalTo(_view1.mas_height).multipliedBy(.15);
        }];
        [_imgView1 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(_subTitleLable1.mas_bottom).offset(5);
            make.centerX.equalTo(_view1.mas_centerX);
            make.width.height.equalTo(self.mas_height).multipliedBy(.5);
            
        }];
                
        [_titleLabel2 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.offset(10);
            make.centerX.equalTo(_view2.mas_centerX);
            make.width.equalTo(_view2.mas_width).multipliedBy(.6);
            make.height.equalTo(_view2.mas_height).multipliedBy(.15);
        }];
        [_subTitleLable2 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(_titleLabel2.mas_bottom).offset(2);
            make.centerX.equalTo(_view2.mas_centerX);
            make.width.equalTo(_view2.mas_width).multipliedBy(.6);
            make.height.equalTo(_view2.mas_height).multipliedBy(.15);
        }];
        [_imgView2 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(_subTitleLable2.mas_bottom).offset(5);
            make.centerX.equalTo(_view2.mas_centerX);
            make.width.height.equalTo(self.mas_height).multipliedBy(.5);
        }];
        
        [_titleLabel3 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.offset(10);
            make.centerX.equalTo(_view3.mas_centerX);
            make.width.equalTo(_view3.mas_width).multipliedBy(.6);
            make.height.equalTo(_view3.mas_height).multipliedBy(.15);
        }];
        [_subTitleLable3 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(_titleLabel3.mas_bottom).offset(2);
            make.centerX.equalTo(_view3.mas_centerX);
            make.width.equalTo(_view3.mas_width).multipliedBy(.6);
            make.height.equalTo(_view3.mas_height).multipliedBy(.15);
        }];
        [_imgView3 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(_subTitleLable3.mas_bottom).offset(5);
            make.centerX.equalTo(_view3.mas_centerX);
            make.width.height.equalTo(self.mas_height).multipliedBy(.5);
        }];
        
    }
    return self;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
